<template>
  <div class="th-link" :class="[`th-link__${type}`, underline && `th-link__underline`]" @click="onClick">
    <slot></slot>
  </div>
</template>
<script lang="ts" setup>
const props = defineProps({
  type: {
    type: String,
    default: "primary",
    validator: (val: string) => {
      return ["primary", "success", "warning", "error", "info"].includes(val);
    },
  },
  underline: {
    type: Boolean,
    default: true,
  },
});

const emits = defineEmits(["link"]);
function onClick() {
  emits("link");
}
</script>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "Link",
});
</script>
